package com.miaoshare.app.mvp.model;

import com.miaoshare.app.net.RetrofitClient;
import com.miaoshare.core.base.BaseModel;
import com.miaoshare.core.net.HttpListener;

/**
 * Created by HeroSun
 * date 2022-02-14
 **/
public class MainModel extends BaseModel {
    //模拟登陆接口
    public void login(String userName, String passWord, HttpListener listener) {
        sendRequest(RetrofitClient.getInstance().getApiService().getUserInfo(userName), new HttpListener() {
            @Override
            public void onSuccess(Object object) {
                //数据校验、处理
                listener.onSuccess(object);
            }

            @Override
            public void onError(String errorMsg, String code) {
                listener.onError(errorMsg, code);
            }
        });
    }

}
